using System;
using System.Reflection;
using System.Web.Mvc;
using Ext.Net;
using ilanver.Web.Controllers.Backoffice.Plugin;
using ilanver.Web.NHibernate;

namespace ilanver.Web.Controllers.Backoffice
{
    public class HomeController : Controller
    {
        //[Transaction]
        //[Authorize]
        [AcceptVerbs(HttpVerbs.Get)]
        public ActionResult Index()
        {
            //Assembly thisAssem = Assembly.GetExecutingAssembly();
            //AssemblyName thisAssemName = thisAssem.GetName();
            //Version ver = thisAssemName.Version;

            //ViewData["AppName"] = "<b>Backoffice</b> " + string.Format("({0} - Versiyon)", ver);
            //ViewData["Username"] = HttpContext.User.Identity.Name;
            //ViewData["LastInLogin"] = "Son Giriş: " + DateTime.Now.ToShortDateString();

            return View();
        }

        //[Transaction]
        //[Authorize]
        public ActionResult Dashboard()
        {
            return View();
        }

        //[Transaction]
        //[Authorize]
        public ActionResult About()
        {
            return View();
        }

        //[Transaction]
        //[Authorize]
        public ActionResult Form()
        {
            return View();
        }

        //[Transaction]
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult SaveForm(string txtName, string txtEmail, string txtComments)
        {
            var result = new AjaxFormResult();

            result.Script = ExtNet.Msg.Alert("Başarılı", "Hata raporu gönderildi.").ToScript();

            return result;
        }
    }
}